﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Score.aspx.cs" Inherits="ExamAnalysis.Score" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <script type="text/javascript">
        var percent = function (value) {
            return value + "%";
        };

        var submitValue = function (grid, hiddenFormat, format) {
            hiddenFormat.setValue(format);
            grid.submitData(false, { isUpload: true });
        };
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="TitleContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <ext:Hidden ID="FormatType" runat="server" />
    <table border="0" width="1000" style="height:400px;">
        <tr>
            <td style="width:250px;" align="center">
                <img src="../../Images/main/score.jpg" alt="成绩查询" width="200" /></td>
            <td>
                <ext:GridPanel 
                    ID="ScoreGridPanel"
                    runat="server" 
                    Title="" 
                    ColumnLines="true"
                    Height="350">
                    <Store>
                        <ext:Store ID="GridStore" runat="server" OnSubmitData="Store_Submit">
                            <Model>
                                <ext:Model runat="server">
                                    <Fields>
                                        <ext:ModelField Name="ItemID" Type="Int" />
                                        <ext:ModelField Name="ItemName" Type="String" />
                                        <ext:ModelField Name="ItemScore" Type="Int" />
                                        <ext:ModelField Name="Score" Type="Int" />
                                        <ext:ModelField Name="Difficulty" Type="Int" />
                                        <ext:ModelField Name="ReasonID" Type="Int" />
                                        <ext:ModelField Name="ReasonName" Type="String" />
                                        <ext:ModelField Name="KnowledgeID" Type="Int" />
                                        <ext:ModelField Name="KnowledgeName" Type="String" />
                                        <ext:ModelField Name="KnowledgeScoreRate" Type="Float" />
                                    </Fields>
                                </ext:Model>
                            </Model>
                        </ext:Store>
                    </Store>
                    <TopBar>
                        <ext:Toolbar runat="server">
                            <Items>
                                <ext:ComboBox 
                                    ID="CalendarList" 
                                    Width="250" 
                                    runat="server"
                                    FieldLabel="选择学期"
                                    LabelWidth="70"
                                    DisplayField="DisplayName" 
                                    ValueField="CalendarID">
                                    <Store>
                                        <ext:Store runat="server" ID="CalendarStore">
                                            <Model>
                                                <ext:Model runat="server" IDProperty="CalendarID">
                                                    <Fields>
                                                        <ext:ModelField Name="DisplayName" />
                                                        <ext:ModelField Name="CalendarID" />
                                                    </Fields>
                                                </ext:Model>
                                            </Model>
                                        </ext:Store>
                                    </Store>
                                    <DirectEvents>
                                        <Select OnEvent="CanlendarList_SelectedItemChanged" />
                                    </DirectEvents>
                                </ext:ComboBox>
                                <ext:ComboBox 
                                    ID="ExamList" 
                                    Width="250" 
                                    FieldLabel="选择考试"
                                    LabelWidth="70"
                                    runat="server"
                                    DisplayField="ExamName" 
                                    ValueField="ExamID">
                                    <Store>
                                        <ext:Store runat="server" ID="ExamStore">
                                            <Model>
                                                <ext:Model runat="server" IDProperty="ExamID">
                                                    <Fields>
                                                        <ext:ModelField Name="ExamName" />
                                                        <ext:ModelField Name="ExamID" />
                                                    </Fields>
                                                </ext:Model>
                                            </Model>
                                        </ext:Store>
                                    </Store>
                                </ext:ComboBox>
                                <ext:Label ID="StuInfoText" runat="server" Text="" />
                                <ext:Button Text="生成" Icon="Accept" runat="server">
                                    <DirectEvents>
                                        <Click OnEvent="SubmitButton_Click" Timeout="60000"  />
                                    </DirectEvents>
                                </ext:Button>
                                <ext:Button Text="保存" AutoPostBack="true" Icon="Disk" runat="server">
                                    <Listeners>
                                        <Click Handler="submitValue(#{ScoreGridPanel}, #{FormatType}, 'xls');" />
                                    </Listeners>
                                </ext:Button>
                                <ext:Button Text="打印" Icon="Printer" runat="server">
                                    <Listeners>
                                        <Click Handler="javascript:window.print();" />
                                    </Listeners>
                                </ext:Button>
                            </Items>
                        </ext:Toolbar>
                    </TopBar>
                    <ColumnModel runat="server">
                        <Columns>
                            <ext:Column runat="server" Text="编号" Width="40" DataIndex="ItemID" Sortable="true" />
                            <ext:Column runat="server" Text="题目" Width="150" DataIndex="ItemName" Sortable="true" />
                            <ext:Column runat="server" Text="分值" Width="40" DataIndex="ItemScore" Sortable="true" />
                            <ext:Column runat="server" Text="得分" Width="40" DataIndex="Score" Sortable="true" />
                            <ext:Column runat="server" Text="难度" Width="40" DataIndex="Difficulty" Sortable="true" />
                            <ext:Column runat="server" Text="错因" Width="150" DataIndex="ReasonName" Sortable="true" />
                            <ext:Column runat="server" Text="教学内容掌握情况" Sortable="true">
                                <Columns>
                                    <ext:Column Text="知识点" Width="150" DataIndex="KnowledgeName" Sortable="true" />
                                    <ext:Column Text="正确率" Width="60" DataIndex="KnowledgeScoreRate" Sortable="true">
                                        <Renderer Fn="percent" />
                                    </ext:Column>
                                </Columns>
                            </ext:Column>
                        </Columns>
                    </ColumnModel>
                    <BottomBar>
                        <ext:StatusBar runat="server">
                            <Items>
                                <ext:ToolbarTextItem ID="TotalScore" runat="server" Text="总分:0分" />
                                <ext:ToolbarSeparator runat="server" />
                                <ext:ToolbarTextItem ID="FullScore" runat="server" Text="满分:100分" />
                            </Items>
                        </ext:StatusBar>
                    </BottomBar>
                </ext:GridPanel>
            </td>
        </tr>
    </table>
</asp:Content>
